set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
GO

IF EXISTS (SELECT name FROM sysobjects WHERE name = 'mov_getNewListings' AND type = 'P') DROP PROCEDURE mov_getNewListings
GO


-- =============================================
-- Modified:    Sourov Chatterjee
-- Create date: 6/3/2011
-- Description:	This procedure gets new listings

-- =============================================
CREATE PROCEDURE [dbo].[mov_getNewListings] 	

AS
BEGIN

	select m.movie_id ,m.movie_name, (md.movie_dir_fname + ' ' +  md.movie_dir_lname)as dir , mg.movie_genre as genre,
    m.movie_image, m.short_desc 
    from movie m JOIN movie_director md 
    on m.movie_dir_id = md.movie_dir_id
    JOIN movie_genre mg 
    ON m.movie_genre_id = mg.movie_genre_id

    where movie_rel_date >= getdate()-30 
	

END








